home *** CD-ROM | disk | FTP | other *** search
- property ancestor
- global enterList, loopList, exitList, enterListCount, loopListCount, exitListCount, curDataChannel, theRecordingLayer, baseRecordSprOffset, autoHoldFrame, curClipRecord, clipDataField, overFlow, recordFlag, dirtyFlag, recordingDuplicateClip, scoreData, bgdData, fgdFXData, bgdFXData, currentFrame, frameLimit, theStageBounds, onionSkinSpr
-
- on birth me
- set the ancestor of me to birth(script "recordMethods parent")
- return me
- end
-
- on record me
- set layerOverflow to 0
- set theType to getAt(curClipRecord, 1)
- set theGroup to getAt(curClipRecord, 2)
- if isEmptyP(layerMgr) then
- set curDataChannel to addNewSlot(layerMgr, theType, theGroup, clipDataField)
- else
- set curDataChannel to findDuplicateCategory(layerMgr, theGroup)
- if curDataChannel = 0 then
- set recordingDuplicateClip to 0
- if isFullP(layerMgr) then
- set layerOverflow to 1
- set theMessage to "Sorry, you have used up all available channels."
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- else
- set curDataChannel to addNewSlot(layerMgr, theType, theGroup, clipDataField)
- if (theType = "S") or (theType = "P") then
- insertProp(layerMgr, theType, theGroup)
- end if
- end if
- else
- set recordingDuplicateClip to 1
- showOnionSkin(me)
- end if
- end if
- if not layerOverflow then
- set theLayer to getLayer(layerMgr, theGroup)
- set theRecordingLayer to theLayer + baseRecordSprOffset
- buildFilterList(me)
- setupClipData(me)
- cursor(200)
- set the locH of sprite theRecordingLayer to the mouseH
- set the locV of sprite theRecordingLayer to the mouseV
- update(stackMgr)
- showFrame(playbackMgr, currentFrame, theRecordingLayer)
- set enterListCount to count(enterList)
- set loopListCount to count(loopList)
- set exitListCount to count(exitList)
- set cycleCount to 1
- set cycleList to []
- repeat with clipNumber in enterList
- append(cycleList, clipNumber)
- end repeat
- repeat with clipNumber in loopList
- append(cycleList, clipNumber)
- end repeat
- repeat with clipNumber in exitList
- append(cycleList, clipNumber)
- end repeat
- repeat while the mouseUp
- moveRecordingSpr(me, theRecordingLayer, the mouseH, the mouseV)
- set cycleCount to cycleThruClips(me, cycleCount, cycleList)
- end repeat
- if cycleCount <= enterListCount then
- set startList to #enterList
- else
- if cycleCount <= (enterListCount + loopListCount) then
- set startList to #loopList
- set cycleCount to cycleCount - enterListCount
- else
- set startList to #exitList
- set cycleCount to cycleCount - (enterListCount + loopListCount)
- end if
- end if
- beginRecording(me, the mouseH, the mouseV, startList, cycleCount)
- end if
- cursor(-1)
- end
-
- on cycleThruClips me, cycleCount, cycleList
- if the controlDown then
- repeat while the controlDown
- end repeat
- if cycleCount < count(cycleList) then
- set cycleCount to cycleCount + 1
- set the castNum of sprite theRecordingLayer to getAt(cycleList, cycleCount)
- else
- set the castNum of sprite theRecordingLayer to getAt(cycleList, 1)
- set cycleCount to 1
- end if
- updateStage()
- end if
- if the optionDown then
- repeat while the optionDown
- end repeat
- if cycleCount > 1 then
- set cycleCount to cycleCount - 1
- set the castNum of sprite theRecordingLayer to getAt(cycleList, cycleCount)
- else
- set the castNum of sprite theRecordingLayer to getAt(cycleList, count(cycleList))
- set cycleCount to count(cycleList)
- end if
- updateStage()
- end if
- return cycleCount
- end
-
- on beginRecording me, theMouseH, theMouseV, startList, cycleCount
- set theMouseLoc to point(theMouseH, theMouseV)
- if inside(theMouseLoc, theStageBounds) or the shiftDown then
- cursor(200)
- set startFrame to currentFrame
- set overFlow to 0
- if startList = #enterList then
- recordAnticipation(me, cycleCount, theMouseH, theMouseV)
- else
- if startList = #loopList then
- recordExecution(me, cycleCount, theMouseH, theMouseV)
- else
- recordFollowThru(me, cycleCount, theMouseH, theMouseV)
- end if
- end if
- if overFlow then
- showOverFlowDialog(me)
- end if
- cursor(4)
- extendClips(me)
- if currentFrame > 1 then
- decrementFrame()
- end if
- incrementCounter(playbackMgr)
- if recordingDuplicateClip then
- hideOnionSkin(me)
- end if
- showFrame(playbackMgr, currentFrame, 0)
- set dirtyFlag to 1
- updateTheBrain(appMgr)
- cursor(-1)
- else
- cursor(4)
- deleteLastSlot(layerMgr, getAt(curClipRecord, 2))
- update(stackMgr)
- hideRecordingSpr(me, theRecordingLayer)
- if recordingDuplicateClip then
- hideOnionSkin(me)
- end if
- showFrame(playbackMgr, currentFrame, 0)
- cursor(-1)
- end if
- end
-
- on recordAnticipation me, cycleCount, theClipH, theClipV
- repeat with theClipNumber = cycleCount to enterListCount
- if currentFrame < frameLimit then
- if recordingDuplicateClip then
- showOnionSkin(me)
- end if
- if currentFrame > count(scoreData) then
- setAt(scoreData, currentFrame, copyList(autoHoldFrame))
- end if
- set theClip to getAt(enterList, theClipNumber)
- set the castNum of sprite theRecordingLayer to theClip
- if the mouseDown then
- set theClipH to the mouseH
- set theClipV to the mouseV
- end if
- set the loc of sprite theRecordingLayer to point(theClipH, theClipV)
- setAt(getAt(scoreData, currentFrame), curDataChannel, list(theClip, theClipH, theClipV))
- incrementCounter(playbackMgr)
- setKrustyForRecording(playbackMgr)
- showFrame(playbackMgr, currentFrame, theRecordingLayer)
- set currentFrame to currentFrame + 1
- next repeat
- end if
- set overFlow to 1
- exit repeat
- end repeat
- if not overFlow then
- set cycleCount to 1
- recordExecution(me, cycleCount, theClipH, theClipV)
- end if
- end
-
- on recordExecution me, cycleCount, theClipH, theClipV
- repeat with theClipNumber = cycleCount to loopListCount
- if currentFrame < frameLimit then
- if recordingDuplicateClip then
- showOnionSkin(me)
- end if
- if currentFrame > count(scoreData) then
- setAt(scoreData, currentFrame, copyList(autoHoldFrame))
- end if
- set theClip to getAt(loopList, theClipNumber)
- set the castNum of sprite theRecordingLayer to theClip
- if the mouseDown then
- set theClipH to the mouseH
- set theClipV to the mouseV
- end if
- set the loc of sprite theRecordingLayer to point(theClipH, theClipV)
- setAt(getAt(scoreData, currentFrame), curDataChannel, list(theClip, theClipH, theClipV))
- incrementCounter(playbackMgr)
- setKrustyForRecording(playbackMgr)
- showFrame(playbackMgr, currentFrame, theRecordingLayer)
- set currentFrame to currentFrame + 1
- next repeat
- end if
- set overFlow to 1
- exit repeat
- end repeat
- if not overFlow then
- recordLoopingExecution(me, cycleCount, theClipH, theClipV)
- end if
- end
-
- on recordLoopingExecution me, cycleCount, theClipH, theClipV
- repeat while the mouseDown
- repeat with theClip in loopList
- if currentFrame < frameLimit then
- if recordingDuplicateClip then
- showOnionSkin(me)
- end if
- if currentFrame > count(scoreData) then
- setAt(scoreData, currentFrame, copyList(autoHoldFrame))
- end if
- set the castNum of sprite theRecordingLayer to theClip
- if the mouseDown then
- set theClipH to the mouseH
- set theClipV to the mouseV
- end if
- set the loc of sprite theRecordingLayer to point(theClipH, theClipV)
- setAt(getAt(scoreData, currentFrame), curDataChannel, list(theClip, theClipH, theClipV))
- incrementCounter(playbackMgr)
- setKrustyForRecording(playbackMgr)
- showFrame(playbackMgr, currentFrame, theRecordingLayer)
- set currentFrame to currentFrame + 1
- next repeat
- end if
- set overFlow to 1
- exit repeat
- end repeat
- end repeat
- if not overFlow then
- set cycleCount to 1
- recordFollowThru(me, cycleCount, theClipH, theClipV)
- end if
- end
-
- on recordFollowThru me, cycleCount, theClipH, theClipV
- repeat with theClipNumber = cycleCount to exitListCount
- if currentFrame < frameLimit then
- if recordingDuplicateClip then
- showOnionSkin(me)
- end if
- if currentFrame > count(scoreData) then
- setAt(scoreData, currentFrame, copyList(autoHoldFrame))
- end if
- set theClip to getAt(exitList, theClipNumber)
- set the castNum of sprite theRecordingLayer to theClip
- if the mouseDown then
- set theClipH to the mouseH
- set theClipV to the mouseV
- end if
- set the loc of sprite theRecordingLayer to point(theClipH, theClipV)
- setAt(getAt(scoreData, currentFrame), curDataChannel, list(theClip, theClipH, theClipV))
- incrementCounter(playbackMgr)
- setKrustyForRecording(playbackMgr)
- showFrame(playbackMgr, currentFrame, theRecordingLayer)
- set currentFrame to currentFrame + 1
- next repeat
- end if
- set overFlow to 1
- exit repeat
- end repeat
- end
-
- on showOnionSkin me
- if currentFrame <= count(scoreData) then
- set onionClip to getAt(getAt(scoreData, currentFrame), curDataChannel)
- if onionClip <> EMPTY then
- set the castNum of sprite onionSkinSpr to getAt(onionClip, 1)
- set the loc of sprite onionSkinSpr to point(getAt(onionClip, 2), getAt(onionClip, 3))
- else
- hideOnionSkin(me)
- end if
- else
- hideOnionSkin(me)
- end if
- end
-
- on hideOnionSkin me
- set the locH of sprite onionSkinSpr to -1000
- end
-